/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package escom.ipn.modelo.delegate;
import escom.ipn.modelo.dto.loginClass;
import escom.ipn.modelo.facade.loginFacede;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLDataException;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Daniel
 */
public class loginDelegate_1 {
    private Connection cnn;
    private loginFacede af;
    
    public loginDelegate_1(){
        String usuario="root";
        String clave="root";
        String url="jdbc:mysql://localhost:3306/CAD_DELTA";
        String driver="com.mysql.jdbc.Driver";
        try{
            Class.forName(driver);
            cnn = DriverManager.
                    getConnection(url,usuario,clave);
        }catch(Exception e){
            e.printStackTrace(); 
        }
        af=new loginFacede(cnn);
    }
    
    public loginClass mostrarUsuario(loginClass a)
            throws SQLException{
        return af.leer(a);
    }
    
    public void guardarUsuario(loginClass a)
            throws SQLException{
         af.guardar(a);
    }
}
      